package cn.buk.tms.eotms.report.dto;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 统计报表的内容
 *
 * @author yfdai
 */
public class ReportStatisticDto {

	/**
	 * 0-机票
	 */
	private int objectType;


	private String op1;


	private String carrier;

	private int count;

	// 未支付
	private double unpaidTotalAmount;

	private double unpaidTotalCost;

	private double unpaidTotalProfit;

	// 已支付
	private double paidTotalAmount;

	private double paidTotalCost;

	private double paidTotalProfit;

	// 总的
	private double totalAmount;

	private double totalCost;

	private double totalProfit;

	private List<ReportStatSubItemDto> items;

	private double preProcessDouble(double val) {
		BigDecimal bd = BigDecimal.valueOf(val);
		bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);

		return bd.doubleValue();
	}

	public int getObjectType() {
		return objectType;
	}

	public void setObjectType(int objectType) {
		this.objectType = objectType;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(double totalAmount) {
		this.totalAmount = preProcessDouble(totalAmount);
	}

	public double getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(double totalCost) {
		this.totalCost = preProcessDouble(totalCost);
	}

	public double getTotalProfit() {
		return totalProfit;
	}

	public void setTotalProfit(double totalProfit) {
		this.totalProfit = preProcessDouble(totalProfit);
	}

	public String getOp1() {
		return op1;
	}

	public void setOp1(String op1) {
		this.op1 = op1;
	}

	public double getUnpaidTotalAmount() {
		return unpaidTotalAmount;
	}

	public void setUnpaidTotalAmount(double unpaidTotalAmount) {
		this.unpaidTotalAmount = preProcessDouble(unpaidTotalAmount);
	}

	public double getUnpaidTotalCost() {
		return unpaidTotalCost;
	}

	public void setUnpaidTotalCost(double unpaidTotalCost) {
		this.unpaidTotalCost = preProcessDouble(unpaidTotalCost);
	}

	public double getUnpaidTotalProfit() {
		return unpaidTotalProfit;
	}

	public void setUnpaidTotalProfit(double unpaidTotalProfit) {
		this.unpaidTotalProfit = preProcessDouble(unpaidTotalProfit);
	}

	public double getPaidTotalCost() {
		return paidTotalCost;
	}

	public void setPaidTotalCost(double paidTotalCost) {
		this.paidTotalCost = preProcessDouble(paidTotalCost);
	}

	public double getPaidTotalProfit() {
		return paidTotalProfit;
	}

	public void setPaidTotalProfit(double paidTotalProfit) {
		this.paidTotalProfit = preProcessDouble(paidTotalProfit);
	}

	public double getPaidTotalAmount() {
		return paidTotalAmount;
	}

	public void setPaidTotalAmount(double paidTotalAmount) {
		this.paidTotalAmount = preProcessDouble(paidTotalAmount);
	}

	public List<ReportStatSubItemDto> getItems() {
		if (items == null) {
			items = new ArrayList<>();
		}
		return items;
	}

	public void setItems(List<ReportStatSubItemDto> items) {
		this.items = items;
	}


	public String getCarrier() {
		return carrier;
	}

	public void setCarrier(String carrier) {
		this.carrier = carrier;
	}

}
